//查询数据源所有数据(datatable_id数据源id,condition查询条件,values查询条件值数组,success查询成功回调函数,fail查询失败回调函数)
function cx_sysj(datatable_id,condition,values,success,fail){
    const args = {
      "datatable_id": datatable_id,
      "search": "",
      "search_fields": [
      ],
      "advance_filters": {condition: condition, values: values},
      "page": 1,
      "page_size": 999999,
    }
    ycWindow.plugins.crud.Query(args, (result) => {
      if(success){
        success(result);
      }
    }, (data) => {
      if(fail){
        fail(data);
      }
    })
  }
  //查询数据源所有数据，可设置字段(datatable_id数据源id,fields字段名称数组,condition查询条件,values查询条件值数组,success查询成功回调函数,fail查询失败回调函数)
  function cx_syzdsj(datatable_id,fields,condition,values,success,fail){
    var search_fields=[];
    fields.forEach(item => {
        search_fields.push({
            "quick_search": true,
            "field": item,
            "table": "a",
            "data_type": 1
        })
    });
    const args = {
      "datatable_id": datatable_id,
      "search": "",
      "search_fields": search_fields,
      "advance_filters": {condition: condition, values: values},
      "page": 1,
      "page_size": 999999,
    }
    ycWindow.plugins.crud.Query(args, (result) => {
      if(success){
        success(result);
      }
    }, (data) => {
      if(fail){
        fail(data);
      }
    })
  }
  //查询数据源所有数据，可设置字段，可外联表(datatable_id数据源id,fields字段数组[{"field":XXX，"data_type":XXX}],condition查询条件,values查询条件值数组,join_tables外联表,success查询成功回调函数,fail查询失败回调函数)
  function cx_syzdsj_plus(datatable_id,fields,condition,values,join_tables,success,fail){
    var search_fields=[];
    fields.forEach(item => {
        search_fields.push({
            "quick_search": true,
            "field": item.field,
            "table": "a",
            "data_type": item.data_type
        })
    });
    const args = {
      "datatable_id": datatable_id,
      "search": "",
      "search_fields": search_fields,
      "advance_filters": {condition: condition, values: values},
      "join_tables": join_tables,
      "page": 1,
      "page_size": 999999,
    }
    ycWindow.plugins.crud.Query(args, (result) => {
      if(success){
        success(result);
      }
    }, (data) => {
      if(fail){
        fail(data);
      }
    })
  }
  //查询数据源所有数据，可设置字段，可外联表，支持分组(datatable_id数据源id,fields字段数组[{"field":XXX，"data_type":XXX}],condition查询条件,values查询条件值数组,join_tables外联表,success查询成功回调函数,fail查询失败回调函数)
  function cx_syzdsj_plus2(datatable_id,fields,condition,values,join_tables,group_by,success,fail){
    var search_fields=[];
    fields.forEach(item => {
        search_fields.push({
            "quick_search": true,
            "field": item.field,
            "table": item.data_type!=11?"a":"",
            "data_type": item.data_type
        })
    });
    const args = {
        "datatable_id": datatable_id,
        "search": "",
        "search_fields": search_fields,
        "advance_filters": {condition: condition, values: values},
        "join_tables": join_tables,
        "group_by": group_by,
        "page": 1,
        "page_size": 999999,
    }
    ycWindow.plugins.crud.Query(args, (result) => {
        if(success){
        success(result);
        }
    }, (data) => {
        if(fail){
        fail(data);
        }
    })
  }
  